<%@ Page Title="Log_ErrorLog Item" Language="C#" AutoEventWireup="true" CodeBehind="Log_ErrorLogItem.aspx.cs" Inherits="Youz.CreditRepay.Manage.Log_ErrorLogItem" %>

<script>
    

    var requireJS = [
        //"assets/js/jquery.form.js"
    ];
    loadJS(requireJS);
</script>
<div class="row">
    <div class="col-lg-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h2><i class="fa fa-edit"></i><%: R(LanguageModule.Log_ErrorLog, "Log_ErrorLog", "Log_ErrorLog") %></h2>
            </div>
            <div class="panel-body">
                <form id="frm" class="form-horizontal" method="post" enctype="multipart/form-data" action="Right/Handlers/Log_ErrorLogHandler.ashx?type=save">
                    <input id="ErrorLogID" name="ErrorLogID" type="hidden" />
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "Host", "Host") %></label>
                        <div class="controls">
                            <input type="text" id="Host" name="Host" maxlength="100" class="form-control" /></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "RequestType", "RequestType") %></label>
                        <div class="controls">
                            <input type="text" id="RequestType" name="RequestType" maxlength="50" class="form-control" /></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "LoginType", "1、管理员登录日志   2、前台会员登录日志") %></label>
                        <div class="controls">
                            <input type="text" id="LoginType" name="LoginType" maxlength="4" class="form-control" /></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "AbsolutePath", "AbsolutePath") %></label>
                        <div class="controls">
                            <textarea id="AbsolutePath" name="AbsolutePath" rows="3" maxlength="500" class="form-control"></textarea></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "PostData", "PostData") %></label>
                        <div class="controls">
                            <input type="text" id="PostData" name="PostData" maxlength="-1" class="form-control" /></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "QueryString", "QueryString") %></label>
                        <div class="controls">
                            <textarea id="QueryString" name="QueryString" rows="3" maxlength="500" class="form-control"></textarea></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "UserHostAddress", "UserHostAddress") %></label>
                        <div class="controls">
                            <textarea id="UserHostAddress" name="UserHostAddress" rows="3" maxlength="500" class="form-control"></textarea></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "UserAgent", "UserAgent") %></label>
                        <div class="controls">
                            <textarea id="UserAgent" name="UserAgent" rows="3" maxlength="500" class="form-control"></textarea></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "Source", "Source") %></label>
                        <div class="controls">
                            <textarea id="Source" name="Source" rows="3" maxlength="500" class="form-control"></textarea></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "TargetSite", "TargetSite") %></label>
                        <div class="controls">
                            <textarea id="TargetSite" name="TargetSite" rows="3" maxlength="500" class="form-control"></textarea></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "ErrMess", "ErrMess") %></label>
                        <div class="controls">
                            <textarea id="ErrMess" name="ErrMess" rows="3" maxlength="500" class="form-control"></textarea></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "BaseErrMess", "BaseErrMess") %></label>
                        <div class="controls">
                            <textarea id="BaseErrMess" name="BaseErrMess" rows="3" maxlength="500" class="form-control"></textarea></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "StackTraceErr", "StackTraceErr") %></label>
                        <div class="controls">
                            <input type="text" id="StackTraceErr" name="StackTraceErr" maxlength="-1" class="form-control" /></div>
                    </div>
                    <div class="form-group">
                        <label class="control-label" for="RoleDesc"><%: R(LanguageModule.Log_ErrorLog, "CreateTime", "创建时间") %></label>
                        <div class="controls">
                            <input type="text" id="CreateTime" name="CreateTime" maxlength="8" class="form-control" /></div>
                    </div>
                    <div class="alert alert-danger" style="display: none;">
                        <button type="button" class="close" data-dismiss="alert">×</button><strong>Oh snap!</strong><span class="content"></span></div>
                    <div class="form-actions">
                        <button class="btn btn-success" type="submit" id="btnSubmit"><%: R(LanguageModule.M_Common, "btnSubmit", "保存修改") %></button>
                        <button class="btn btn-default" type="button" id="btnCancel"><%: R(LanguageModule.M_Common, "btnCancel", "取消") %></button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">

    var flag = false;

    function validate() {
        return $("#frm").valid();
    };

    function get() {
        $.post("Log/Handlers/Log_ErrorLogHandler.ashx?type=get", { ErrorLogID: "<%= WebHelper.Get("ErrorLogID") %>" }, function (data) {
            $('#frm').fill(data);
        }, 'json');
    }

    $(function () {
        $("#frm").validate({
            errorElement: "span"
        });

        get();

        $("#frm").ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, $form, options) {
                if (flag) {
                    return false;
                }
                else {
                    flag = true;
                    return true;
                }
            },
            success: function (data) {
                if (data.isSuccess) {
                    loadPage("Log/Log_ErrorLogList.aspx");
                }
                else {
                    $(".alert > .content").html(data.message);
                    $(".alert").show();
                }
                flag = false;
            }
        });

        $("#btnCancel").click(function () {
            loadPage("Log/Log_ErrorLogList.aspx");
        });
    });

</script>
